import Home from './pages/Home';
import Products from './pages/Products';
import ProductDetail from './pages/ProductDetail';
import Cart from './pages/Cart';
import Checkout from './pages/Checkout';
import Orders from './pages/Orders';
import OrderDetail from './pages/OrderDetail';
import Profile from './pages/Profile';
import Login from './pages/Login';
import AdminDashboard from './pages/AdminDashboard';
import type { ReactNode } from 'react';

export interface RouteConfig {
  name: string;
  path: string;
  element: ReactNode;
  visible?: boolean;
}

const routes: RouteConfig[] = [
  {
    name: '首页',
    path: '/',
    element: <Home />,
    visible: true
  },
  {
    name: '商品',
    path: '/products',
    element: <Products />,
    visible: true
  },
  {
    name: '商品详情',
    path: '/products/:id',
    element: <ProductDetail />,
    visible: false
  },
  {
    name: '购物车',
    path: '/cart',
    element: <Cart />,
    visible: true
  },
  {
    name: '结算',
    path: '/checkout',
    element: <Checkout />,
    visible: false
  },
  {
    name: '我的订单',
    path: '/orders',
    element: <Orders />,
    visible: true
  },
  {
    name: '订单详情',
    path: '/orders/:id',
    element: <OrderDetail />,
    visible: false
  },
  {
    name: '个人中心',
    path: '/profile',
    element: <Profile />,
    visible: true
  },
  {
    name: '登录',
    path: '/login',
    element: <Login />,
    visible: false
  },
  {
    name: '管理后台',
    path: '/admin',
    element: <AdminDashboard />,
    visible: false
  }
];

export default routes;